import {createRouter, createWebHistory} from 'vue-router'
import Index from "@/components/index.vue";
import BusinessList from "@/components/businessList.vue";
import BusinessInfo from "@/components/businessInfo.vue";
import Login from '@/components/login.vue'
import Orders from "@/components/orders.vue";
import UserAddress from "@/components/userAddress.vue";
import Payment from "@/components/payment.vue";
import OrderList from "@/components/orderList.vue";
import AddUserAddress from "@/components/addUserAddress.vue";
import EditUserAddress from "@/components/editUserAddress.vue";
import Register from "@/components/register.vue";
import Mine from "@/components/Mine.vue";

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'Home',
            component: Index
        },
        {
            path: '/index',
            name: 'Index',
            component: Index
        },
        {
            path: '/businessList',
            name: 'BusinessList',
            component: BusinessList
        },
        {
            path: '/businessInfo',
            name: 'BusinessInfo',
            component: BusinessInfo
        },
        {
            path: '/login',
            name: 'Login',
            component: Login
        },
        {
            path: '/orders',
            name: 'Orders',
            component: Orders
        },
        {
            path: '/userAddress',
            name: 'UserAddress',
            component: UserAddress
        },
        {
            path: '/payment',
            name: 'Payment',
            component: Payment
        },
        {
            path: '/orderList',
            name: 'OrderList',
            component: OrderList
        },
        {
            path: '/addUserAddress',
            name: 'AddUserAddress',
            component: AddUserAddress
        },
        {
            path: '/editUserAddress',
            name: 'EditUserAddress',
            component: EditUserAddress
        },
        {
            path: '/register',
            name: 'Register',
            component: Register
        },
        {
            path:'/mine',
            name: 'mine',
            component: Mine
        }
    ],
    scrollBehavior() {
        return{
            top:0
        }
    },

})
export default router
